<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>

	<h:form>
		<span>Nom :</span> <h:inputText value="#{mbRecherche.nom}" />
		<br />
		<span>Lieu :</span><h:inputText value="#{mbRecherche.lieu}" />
		<span>Prix :</span> <h:selectOneMenu value="#{mbRecherche.prixKey}">
				<f:selectItem itemValue="0" itemLabel="-"/>
				<f:selectItem itemValue="1" itemLabel="20 euros et moins"/>
				<f:selectItem itemValue="2" itemLabel="Entre 20 et 40 euros"/>
				<f:selectItem itemValue="3" itemLabel="40 euros et plus"/>
		</h:selectOneMenu>
		<span>Genre :</span> <h:selectOneMenu value="#{mbRecherche.idGenreSelected}">
			<f:selectItems value="#{mbRecherche.listeGenres}" />
		</h:selectOneMenu>
		<span>Audience :</span> <h:selectOneMenu value="#{mbRecherche.idAudienceSelected}">
			<f:selectItems value="#{mbRecherche.listeAudiences}" />
		</h:selectOneMenu>
		<span>Date :</span> <h:selectOneMenu value="#{mbRecherche.nbJourDateAdd}">
			<f:selectItems value="#{mbRecherche.listeDates}" />
		</h:selectOneMenu>
		<h:commandButton value="GO!" action="#{mbRecherche.rechercher}"/>
	
	
	
		<h:dataTable value="#{mbRecherche.lesSpectacles}" var="leSpectacle">
			
			<h:column>
				<f:facet name="header">
					<h:outputText value="photo" />
				</f:facet>
				<h:graphicImage url="/images/#{leSpectacle.spectacleDonnees.idSpectacleDonnees}.jpg" alt="pas de photo !" />
			</h:column>
			
			<h:column>
				<f:facet name="header">
					<h:outputText value="nom" />
				</f:facet>
				<h:commandLink value="#{leSpectacle.spectacleDonnees.nom}" actionListener="#{mbSpectacle.start}">
					<f:attribute name="idSpectacle" value="#{leSpectacle.idSpectacle}"/>
				</h:commandLink>
			</h:column>
			
			<h:column>
				<f:facet name="header">
					<h:outputText value="note" />
				</f:facet>
				<h:outputText value="#{leSpectacle.spectacleDonnees.noteMoyenne}" />
			</h:column>
			
			<h:column>
				<f:facet name="header">
					<h:outputText value="audience" />
				</f:facet>
				<h:outputText value="#{leSpectacle.spectacleDonnees.audience.nomAudience}" />
			</h:column>
			
			<h:column>
				<f:facet name="header">
					<h:outputText value="prix" />
				</f:facet>
				<h:outputText value="#{leSpectacle.prixTTC}">&euro;
					<f:convertNumber maxFractionDigits="2"/>
				</h:outputText>
			</h:column>
			
		</h:dataTable>
	</h:form>